﻿using System;


    class Upcase
    {
        static string ChageToUpper(string text, string tag)
        {
            string openTag = "<" + tag + ">";
            string closingTag = "</" + tag + ">";
            
            while (text.IndexOf(openTag) != -1)
            {
                int indexOpen = text.IndexOf(openTag);
                int indexClose = text.IndexOf(closingTag);
                string textToChange = text.Substring(indexOpen + openTag.Length, indexClose - indexOpen - closingTag.Length+1);
                text = text.Replace(openTag + textToChange + closingTag, textToChange.ToUpper());
            }
            return text;
        }
        static void Main(string[] args)
        {
            string text = "We are living in an <upcase>yellow</upcase> submarine." +
                         "We don't have <upcase>anything</upcase> else.";
            string tag = "upcase";
            Console.WriteLine(ChageToUpper(text,tag));
        }
    }

